#ifndef _VIRTUAL_PROCESSOR_H_
#define _VIRTUAL_PROCESSOR_H_



class VirtualProcessor
{
	private:
		//Memory the processor accesses. It might not technically be
		//virtual memory but that depends on the mapping scheme used
		VMVirtualMemory* memory; 
		//the command processor that tries to mimic the 
		//processor of the system.
		CommandProcessor* processor;
		//command Builder used to build command objects that are
		//read in from memory so the command processor can execute 
		//them without too much of a problem
		CommandBuilder* builder;

		//a vector of registers that the virtual processor uses 
		//for dealing with commands. This includes basic operations as
		//well such as finding the next instruction. So the PC counter
		//falls into the VirtualRegister case. To easily find registers
		//by name is is suggested you make an enum to enumerate all the
		//registers
		Vector<VirtualRegister> registers; 

		
		//a vector of components that the processor or machine
		//has but don't really have any logically place really 
		//to put. For example a hardware timer or hardware usart.
		//you need to run each of these components accordingly 
		//and check if there are any interrupts that need to be
		//executed before executing the next instruction.
		//In other words you execute these evey instruction and
		//have them update whatever they need to accordingly
		//to get a good running impression of whether or not your
		//code works you do not need to include or implement all 
		//components your device has only the ones you are using
		//in your code.
		Vector<Component*> components;

		//interrupts the processor has and could possibly execute.
		//this is similar to components where ones you aren't using
		//you won't need to include to get a decent idea of what is
		//going on when you run your code.
		Vector<Interrupt*> interrupts;

	public :
		//runs the virtual processor one iteration
		//updates all of the components internal states
		//performs all interrupts when required by the program
		virtual void run()=0;

		//this is used to grab data from the processor
		//and print any desired information to the output for
		//debugging and checking the internal state of the system
		//it is up to the user how they want to use this or if
		//they want to use it.
		virtual void print()=0;

		//initializes the virtual processor after it is given
		//all needed configuration data on construction
		virtual void init()=0;

		
};




#endif
